const  express = require('express');
//创建路由实例对象
const router = express.Router();
const artcate_handler = require('../router_handler/artcate')
const expressJoi = require('@escook/express-joi')
const {add_cate_shema, delete_cate_shema,get_cate_shema, update_cate_shema} = require('../schema/artcate')
//挂载路由
router.get('/cates',artcate_handler.getArtCates)

//挂载新增文章分类和别名的路由
router.post('/addcates',expressJoi(add_cate_shema),artcate_handler.addArticleCates)
//挂载删除文章的路由 你为什么又要乱删除 认真做
router.get('/deletecate/:id',expressJoi(delete_cate_shema),artcate_handler.deleteCateById)
//根据id去获取文章分类列表
router.get('/cates/:id',expressJoi(get_cate_shema),artcate_handler.getArtCateById);
//挂载更新文章分类的路由
router.post('/updatecate',expressJoi(update_cate_shema),artcate_handler.updateCateById)
module.exports = router